package cn.ben3.addondsl.model;

import org.springframework.roo.classpath.details.annotations.AnnotationMetadata;
import org.springframework.roo.classpath.details.annotations.AnnotationMetadataBuilder;
import org.springframework.roo.model.JavaSymbolName;
import org.springframework.roo.model.JavaType;

public class AnnotationBuilder {
    private AnnotationMetadataBuilder amb;
    AnnotationBuilder() {
    }

    public AnnotationBuilder(JavaType javaType) {
        this.amb = new AnnotationMetadataBuilder(javaType);
    }

    public AnnotationMetadataBuilder builder() {

        return this.amb;
    }
    public AnnotationMetadata build() {

        return this.amb.build();
    }

    public AnnotationBuilder str(String key, String value) {
        this.amb.addStringAttribute(key,value);
        return this;
    }
    public AnnotationBuilder bol(String key, boolean value) {
        this.amb.addBooleanAttribute(key,value);
        return this;
    } public AnnotationBuilder dbl(String key, Double value) {
        this.amb.addDoubleAttribute(key, value, false);
        return this;
    } public AnnotationBuilder chr(String key, char value) {
        this.amb.addCharAttribute(key, value);
        return this;
    } public AnnotationBuilder typ(String key, JavaType value) {
        this.amb.addClassAttribute(key, value);
        return this;
    } public AnnotationBuilder typ(String key, String value) {
            this.amb.addClassAttribute(key, value);
        return this;
    } public AnnotationBuilder enm(String key, String type,String field) {
        this.amb.addEnumAttribute(key, type, field);
        return this;
    } public AnnotationBuilder enm(String key, JavaType type,String field) {
        this.amb.addEnumAttribute(key, type, field);
        return this;
    } public AnnotationBuilder enm(String key, JavaType type,JavaSymbolName field) {
        this.amb.addEnumAttribute(key, type, field);
        return this;
    } public AnnotationBuilder inT(String key, int value) {
        this.amb.addIntegerAttribute(key, value);
        return this;
    } public AnnotationBuilder lon(String key,long value) {
        this.amb.addLongAttribute(key, value);
        return this;
    }



}
